# 第一阶段：构建阶段
FROM maven:3.6.3-openjdk-8 AS builder
WORKDIR /app
COPY pom.xml .
RUN mvn dependency:go-offline
COPY src ./src
RUN mvn clean package -DskipTests -P prod,!dev

# 第二阶段：运行阶段
FROM java:8
WORKDIR /app
COPY --from=builder /app/target/codefish-seckill-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]